import { CommonEntity } from '../../../../util/entity/common.entity';
import { Column, Entity, ManyToOne } from 'typeorm';
import { User } from '../../../admin/user/entities/user.entity';

@Entity('sys_bookmark')
export class Bookmark extends CommonEntity {
  @Column({ comment: '网站名称' })
  name: string; //名称
  @Column({ comment: '网站类型' })
  type: number; //类型（字典）
  @Column({ comment: '网站链接' })
  link: string; //网页链接
  @Column({ default: 0, comment: '点击次数' })
  count: number; //点击次数
  @Column({ nullable: true, comment: '评分' })
  rate: number; //评分（1-10分）
  @Column({ nullable: true, comment: 'icon图片' })
  imageUrl: string;
  @ManyToOne(() => User, (user) => user.bookmarks)
  user: User;
}
